package modelo.reglas.composite;

import modelo.reglas.CompositeSpecification;
import modelo.reglas.ISpecification;
import modelo.reglas.Specificable;

public class OrSpecification<T extends Specificable> extends
		CompositeSpecification<T> {

	private ISpecification<T> one;
    private ISpecification<T> other;

    public OrSpecification(ISpecification<T> x, ISpecification<T> y) 
    {
        one = x;
        other = y;
    }

    public Boolean isSatisfiedBy(T candidate) 
    {
        return one.isSatisfiedBy(candidate) || other.isSatisfiedBy(candidate);
    }
	
}
